package net.suplementos.dao;

import java.util.List;

import javax.persistence.EntityManager;

import net.suplementos.exception.DAOException;
import net.suplementos.pojo.Estoque;
import net.suplementos.pojo.Lote;

public class LoteDAO  extends JPAAbstractDAO<Lote, Integer> {

	
	public LoteDAO(EntityManager manager) throws DAOException {
	    super(manager);
	}

	protected Class<Lote> doGetClass() {
		return Lote.class;
	}
	
	public List<Lote> listarPorEstoque(Estoque estoque) throws DAOException {
		String hql = "select l from Lote l where l.estoque.id = ?";
		
		return consultar(hql, estoque.getId());
	}
}
